/**
 * 时间戳转换函数
 * @param  {String} jsondate 后端给时间戳 
 * @returns  yyyy-MM-dd HH:mm
 */
export function jsonTime (jsondate) {
    if (!jsondate) return
    jsondate = jsondate.replace("/Date(", "").replace(")/", "")
    if (jsondate.indexOf("+") > 0) {
        jsondate = jsondate.substring(0, jsondate.indexOf("+"))
    } else if (jsondate.indexOf("-") > 0) {
        jsondate = jsondate.substring(0, jsondate.indexOf("-"))
    }

    var date = new Date(parseInt(jsondate, 10))
    var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1
    var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate()
    var hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours()
    var minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()
    var second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds()
    return date.getFullYear() + "-" + month + "-" + currentDate + " " + hour + ":" + minute
}